import axios from './api' // 倒入 api
import config from './config.js' // 倒入默认配置
export const BASEURL = config.baseURL

/* 将所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 */

// 渠道管理-渠道列表-获取渠道星级统计
export const GET_CUSTOMER_LABEL = (params) => {
  return axios({
    url: '/home/customer/label',
    method: 'POST',
    data: params,
  })
}

// 渠道管理-渠道列表-获取渠道星级统计
export const GET_CHANNEL_LABEL_CONTRAST = (params) => {
  return axios({
    url: '/channel/level/contrast',
    method: 'POST',
    data: params,
  })
}

// 业绩排行榜-个人
export const GET_ACHIEVE_PERSONAL_PAGE = (params) => {
  return axios({
    url: '/achieve/personal/page',
    method: 'POST',
    data: params,
  })
}

// 业绩排行榜-团队
export const GET_ACHIEVE_TEAM_PAGE = (params) => {
  return axios({
    url: '/achieve/team/page',
    method: 'POST',
    data: params,
  })
}

// 业绩排行榜-门店
export const GET_ACHIEVE_SHOP_PAGE = (params) => {
  return axios({
    url: '/achieve/shop/page',
    method: 'POST',
    data: params,
  })
}

// 统计报表-渠道报表-星级-获取所有标签
export const GET_STAR_LABEL_PAGE = (params) => {
  return axios({
    url: '/label/all',
    method: 'GET',
    params,
  })
}

// 统计报表-渠道报表-星级-获取统计数据
export const GET_STAR_REPORT_PAGE = (params) => {
  return axios({
    url: '/channel/report/label',
    method: 'POST',
    data:params,
  })
}
